package com.bdf.ipharma.gui;

import javax.swing.ImageIcon;

import com.bdf.ipharma.starter.McdError;

/**
 * A Swing-based panel class.
 * <P>
 * 
 * @author JorgE.H
 */
public class GUIButtonProduct extends GUIButtonImage {

   /**
    * Panel
    */

   /**
    * Attributes
    */


   boolean active = true;

   boolean available;

   int position;

   ImageIcon buttDisabled;

   /**
    * Constructs a new instance.
    * 
    * @param pProd
    *           the Product to add
    * @param pActive
    *           boolean value to set active button state
    * @param pPosition
    *           position index in panel (vector) of products
    */
   public GUIButtonProduct() {

      super(null,null);
      
   }

   /**
    * Constructs a new instance.
    * 
    * @param pLabel
    *           string to show as product label
    * @param pQty
    *           stock available for product
    * @param pCode
    *           string product code
    * @param pActive
    *           boolean value to set active button state
    * @param pHighlight
    *           boolean value to indicate product availability
    * @param pPosition
    *           position index in panel (vector) of products
    */
   public GUIButtonProduct(String pLabel, int pQty, String pCode,
         boolean pActive, boolean pHighlight, int pPosition, ImageIcon pUp,
         ImageIcon pDown) {

      super(pUp, pDown);
      try {
         buttDisabled = pUp;
         position = pPosition;
         active = pActive;
         jbInit();
      } catch (Exception e) {
         McdError.add(e);
      }
   }

   /**
    * Initializes the state of this instance.
    */
   private void jbInit() throws Exception {

      setText(getExtLabel());
      setRequestFocusEnabled(false);
      setDisabledIcon(buttDisabled);


   }

   /**
    * Sets button text
    * 
    * @param pDesc
    *           product description
    * @param pQty
    *           product quantity
    */
   private String getExtLabel() {
	return null;


   }

   /**
    * Sets button label
    * 
    * @param pActive
    *           boolean for button initial state
    */
   public void setProduct() {

     
   }

   /**
    * Sets button active
    * 
    * @param pActive
    *           boolean for button initial state
    */
   public void setActive(boolean pActive) {

      setEnabled(pActive);
   }
}
